/*
 * @功能描述: 
 * @版本: v1.0.0
 * @作者: LuAn
 * @Date: 2021-08-31 06:39:01
 * @LastEditTime: 2021-09-01 06:14:40
 */
#ifndef BIT_OP_H
#define BIT_OP_H
#define BIT_0 (1UL << 0)
#define BIT_1 (1UL << 1)
#define BIT_2 (1UL << 2)
#define BIT_3 (1UL << 3)
#define BIT_4 (1UL << 4)
#define BIT_5 (1UL << 5)
#define BIT_6 (1UL << 6)
#define BIT_7 (1UL << 7)
#define BIT_8 (1UL << 8)
#define BIT_9 (1UL << 9)
#define BIT_10 (1UL << 10)
#define BIT_11 (1UL << 11)
#define BIT_12 (1UL << 12)
#define BIT_13 (1UL << 13)
#define BIT_14 (1UL << 14)
#define BIT_15 (1UL << 15)
#define BIT_16 (1UL << 16)
#define BIT_17 (1UL << 17)
#define BIT_18 (1UL << 18)
#define BIT_19 (1UL << 19)
#define BIT_20 (1UL << 20)
#define BIT_21 (1UL << 21)
#define BIT_22 (1UL << 22)
#define BIT_23 (1UL << 23)
#define BIT_24 (1UL << 24)
#define BIT_25 (1UL << 25)
#define BIT_26 (1UL << 26)
#define BIT_27 (1UL << 27)
#define BIT_28 (1UL << 28)
#define BIT_29 (1UL << 29)
#define BIT_30 (1UL << 30)
#define BIT_31 (1UL << 31)
#define BIT_OP_BIN(B) 0b##B##UL
// BITS 可以是 BIT_0 ... BIT_31的位或组合
#define CLR_BITS_VAL(V, BITS) ((V) & (~(BITS)))
#define SET_BITS_VAL(V, BITS) ((V) | ((BITS)))
#define CLR_BITS(V, BITS) (V) = CLR_BITS_VAL(V, BITS)
#define SET_BITS(V, BITS) (V) = CLR_BITS_VAL(V, BITS)
#endif
